version: '3'

services:
 flask1:
    build: .
    ports:
      - "5001:5000"
    environment:
      - FLASK_APP=app.py
    networks:
      - internal

 flask2:
    build: .
    ports:
      - "5002:5000"
    environment:
      - FLASK_APP=app.py
    networks:
      - internal

 flask3:
    build: .
    ports:
      - "5003:5000"
    environment:
      - FLASK_APP=app.py
    networks:
      - internal

 nginx:
    image: nginx:latest
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - ./nginx.conf:/etc/nginx/nginx.conf
      - ./certs:/etc/nginx/certs
    networks:
      - internal
      - external

networks:
 external:
 internal:

